package cn.edu.seu.ssny.service.impl;

import cn.edu.seu.ssny.dao.IMachineGroupConfigDao;
import cn.edu.seu.ssny.dao.support.IBaseDao;
import cn.edu.seu.ssny.entity.Device;
import cn.edu.seu.ssny.entity.MachineGroup;
import cn.edu.seu.ssny.entity.MachineGroupConfig;
import cn.edu.seu.ssny.service.IMachineGroupConfigService;
import cn.edu.seu.ssny.service.support.impl.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MachineGroupConfigServiceImp extends BaseServiceImpl<MachineGroupConfig, Integer> implements IMachineGroupConfigService {

    @Autowired
    private IMachineGroupConfigDao machineGroupConfigDao;

    @Override
    public IBaseDao<MachineGroupConfig, Integer> getBaseDao() {
        return machineGroupConfigDao;
    }

    @Override
    public List<MachineGroupConfig> findMachineGroupConfigsByMachineGroup(MachineGroup machineGroup) {
        return machineGroupConfigDao.findMachineGroupConfigsByMachineGroup(machineGroup);
    }

    @Override
    public MachineGroupConfig findByMachineGroupAndDevice(MachineGroup machineGroup, Device device) {
        return machineGroupConfigDao.findMachineGroupConfigByMachineGroupAndDevice(machineGroup, device);
    }

    @Override
    public List<MachineGroupConfig> findMachineGroupConfigsByMachineGroupAndType(MachineGroup machineGroup, Integer type) {
        return machineGroupConfigDao.findMachineGroupConfigsByMachineGroupAndType(machineGroup, type);
    }
}
